package widget.book
{
		import flash.display.Sprite;
		import flash.geom.Point;
		import flash.text.TextField;
		/**
		 * ...
		 * @author DefaultUser (Tools -> Custom Arguments...)
		 */
		public class DebugMC extends Sprite
		{
			private var Horizonal	:Point;
			private var Vertical	:Point;
			private var Forth		:Point;
			private var Mouse		:Point;
			
			private var Htext		:TextField;
			private var Vtext		:TextField;
			private var Ftext		:TextField;
			private var Mtext		:TextField;
			
			public function DebugMC() 
			{			
				Horizonal = new Point();
				Vertical = new Point();
				Mouse = new Point();
				
				Htext = tip("Hpoint");
				Vtext = tip("Vpoint");
				Ftext = tip("Fpoint");
				Mtext = tip("Mpoint");
				
				
				this.mouseEnabled = false;
			}
			private function tip(arg:String):TextField {
				var t:TextField = new TextField();
				t.text = arg;
				addChild(t);
				t.selectable = false;
				t.mouseEnabled = false;
				return t;
			}
			private function run() {
				var g = this.graphics;
				g.clear();
				g.lineStyle(2, 0);
				g.moveTo(Mouse.x, Mouse.y);
				g.lineTo(Horizonal.x, Horizonal.y);
				g.lineTo(Vertical.x, Vertical.y);
				if (Forth.x > -10) g.lineTo(Forth.x, Forth.y);
				g.lineTo(Mouse.x, Mouse.y);
				
				Htext.x = Horizonal.x;
				Htext.y = Horizonal.y;
				Vtext.x = Vertical.x;
				Vtext.y = Vertical.y;
				Ftext.x = Forth.x;
				Ftext.y = Forth.y;
				Mtext.x = Mouse.x;
				Mtext.y = Mouse.y;
				
			}
			/**
			 * @function	setPoint
			 * 
			 * @param	m	记录鼠标坐标的point
			 * @param	h	记录水平坐标的point
			 * @param	v	记录垂直坐标的point
			 * 
			 * @usage	设置point
			 */
			public function setPoint(m:Point, h:Point, v:Point,f:Point) {
				Mouse = m;
				Horizonal = h;
				Vertical = v;
				Forth = f;
				run();
			}
			public function clear() {
				this.graphics.clear();
			}
		}
}